package com.yonyou.cyxdms.basedata.service.dto;

import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;

import java.io.Serializable;

/**
 * <p>
 * 车型
 * </p>
 *
 * @author guoy
 * @since 2018-08-22
 */

public class ModelDTO extends BaseDTO implements Serializable {

    /**
     * 用于序列化反序列化
     */
    private static final long serialVersionUID = 1L;

    /**
     * MODELID
     */
    private Long modelId;
    /**
     * SERIESID
     */
    private Long seriesId;
    /**
     * 车型代码
     */
    private String modelCode;
    /**
     * 车型名称
     */
    private String modelName;
    /**
     * 是否有效
     */
    private Integer isValid;
    private Long sourceId;
    /**
     * 来源渠道
     */
    private Integer sourceChannel;

    /**
     * 是否删除
     */
    private Integer isDeleted;


    //告知下游渠道具体的操作类型
    private Integer method;

    public ModelDTO() {
        super();
    }


    public Long getModelId() {
        return modelId;
    }


    public void setModelId(Long modelId) {
        this.modelId = modelId;
    }

    public Long getSeriesId() {
        return seriesId;
    }


    public void setSeriesId(Long seriesId) {
        this.seriesId = seriesId;
    }

    public String getModelCode() {
        return modelCode;
    }


    public void setModelCode(String modelCode) {
        this.modelCode = modelCode;
    }

    public String getModelName() {
        return modelName;
    }


    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public Integer getIsValid() {
        return isValid;
    }


    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public Long getSourceId() {
        return sourceId;
    }


    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }

    public Integer getSourceChannel() {
        return sourceChannel;
    }


    public void setSourceChannel(Integer sourceChannel) {
        this.sourceChannel = sourceChannel;
    }


    public Integer getIsDeleted() {
        return isDeleted;
    }


    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }


    public Integer getMethod() {
        return method;
    }


    public void setMethod(Integer method) {
        this.method = method;
    }


    @Override
    public String toString() {
        return "ModelDTO{" +
                ", modelId=" + modelId +
                ", seriesId=" + seriesId +
                ", modelCode=" + modelCode +
                ", modelName=" + modelName +
                ", isValid=" + isValid +
                ", sourceId=" + sourceId +
                ", sourceChannel=" + sourceChannel +
                ", isDeleted=" + isDeleted +
                "}";
    }

    /**
     * 将DTO 转换为PO
     *
     * @param poClass dto 需要转换的dto
     * @author guoy
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     *
     * @param po 需要转换的对象
     * @author guoy
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "contentId");
    }

}
